import { Handle, Position } from 'reactflow'
import './index.css'
import { Sub } from '../../MyIcon/'
import React from 'react'
function MyNode(props) {
  return (
    <>
      <Handle type="target" position={Position.Top} />
      <div className="MyNode">
        <div>{props?.data?.label}</div>
        <i
          onClick={() => {
            console.log(props)
            console.log(props.data.onDelete)
            props.data.onDelete ? props.data.onDelete(props) : ''
          }}
        >
          <Sub />
        </i>
        {/* 用于指定与其他节点连接的位置 */}
        <Handle type="source" position={Position.Bottom} id="a" />
      </div>
    </>
  )
}

// 自定义节点类型
export default React.memo(MyNode)
